/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

package com.techshop.service.impl;

import com.techshop.dao.CategoryDao;
import com.techshop.model.Category;
import com.techshop.service.CategoryService;
import java.util.List;

/**
 *
 * @author Hai-PC
 */
public class CategoryServiceImpl implements CategoryService
{
    private CategoryDao categoryDao;
    
    @Override
    public Category getById(int categoryId)
    {
        return this.getCategoryDao().getById(categoryId);
    }

    @Override
    public List<Category> findAll()
    {
        return this.getCategoryDao().findAll();
    }

    @Override
    public boolean insert(Category category)
    {
        return this.getCategoryDao().insert(category);
    }

    @Override
    public boolean update(Category category)
    {
        return this.getCategoryDao().update(category);
    }

    @Override
    public boolean delete(Category category)
    {
        return this.getCategoryDao().delete(category);
    }

    /**
     * @return the categoryDao
     */
    public CategoryDao getCategoryDao()
    {
        return categoryDao;
    }

    /**
     * @param categoryDao the categoryDao to set
     */
    public void setCategoryDao(CategoryDao categoryDao)
    {
        this.categoryDao = categoryDao;
    }
}